﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LabTask1Sharp
{
    class Node
    {
        public string Name { get; set; }
        public int X { get; set; }
        public int Y { get; set; }
        public bool IsStart { get; set; }
        public bool IsEnd { get; set; }
        public bool Expanded { get; set; }

        public Node()
        {
            Name = "";
            X = Y = 0;
            IsStart = IsEnd = Expanded = false;
        }

        public Node(string Name, int X, int Y)
        {
            this.Name = Name;
            this.X = X;
            this.Y = Y;
            IsStart = IsEnd = Expanded = false;
        }

        public void Print()
        {
            Console.WriteLine("Name: " + Name +" X: " + X + " Y: " + Y);
        }

        public double GetDistanceTo(Node node)
        {
            return Math.Sqrt(Math.Pow(this.X - node.X, 2) + Math.Pow(this.Y - node.Y, 2));
        }

    }
}
